import request from '@/utils/request'

// 查询客服列表
export function listKefu(query) {
  return request({
    url: '/weixinsys/kefu/list',
    method: 'get',
    params: query
  })
}

// 查询客服详细
export function getKefu(id) {
  return request({
    url: '/weixinsys/kefu/' + id,
    method: 'get'
  })
}

// 新增客服
export function addKefu(data) {
  return request({
    url: '/weixinsys/kefu',
    method: 'post',
    data: data
  })
}

// 修改客服
export function updateKefu(data) {
  return request({
    url: '/weixinsys/kefu',
    method: 'put',
    data: data
  })
}

// 删除客服
export function delKefu(id) {
  return request({
    url: '/weixinsys/kefu/' + id,
    method: 'delete'
  })
}

// 导出客服
export function exportKefu(query) {
  return request({
    url: '/weixinsys/kefu/export',
    method: 'get',
    params: query
  })
}

// 绑定客服
export function bindKefu(query) {
  return request({
    url: '/weixinsys/kefu/bind',
    method: 'post',
    data: query
  })
}

// 修改头像
export function updateKefuAvatar(query) {
  return request({
    url: '/weixinsys/kefu/uploadheadimg',
    method: 'post',
    data: query
  })
}

// 同步客服
export function syncKefu(query) {
  return request({
    url: '/weixinsys/kefu/synckefu',
    method: 'get',
    params: query
  })
}